# A valid snippet should starts with:
#
#		snippet trigger_word [ "description" [ options ] ]
#
# and end with:
#
#		endsnippet
#
# Snippet options:
#
#		b - Beginning of line.
#		i - In-word expansion.
#		w - Word boundary.
#		r - Regular expression
#		e - Custom context snippet
#		A - Snippet will be triggered automatically, when condition matches.
#
# Basic example:
#
#		snippet emitter "emitter properties" b
#		private readonly ${1} = new Emitter<$2>()
#		public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event
#		endsnippet
#
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt

snippet template_masm "basic template for masm" b
assume cs: ${1:codesg}

$1 segment

start: ${2:code}

$1 ends

end
endsnippet

snippet template_gas "basic template for gas" b
.section .data

.section .bbs

.section .text

.globl main
main:
    $1
endsnippet

snippet template_nasm "basic template for nasm" b
section .data

section .bbs

section .text
	global _start

_start:
    $1
endsnippet

snippet func_call_gas	"gas function templete" b
.type	${1:name},  @function
$1:
    pushl   %ebp
    movl    %esp,   %ebp
    $2
    movl    %ebp,   %esp
    popl    %ebp
    ret
endsnippet

snippet syscall "system call templete for nasm" b
mov 	%eax,	${1:num}
mov 	%ebx, 	${2:para1}
mov 	%ecx, 	${3:para2}
mov 	%edx, 	${4:para3}
syscall
endsnippet
